package ui;

import java.awt.Dimension;
import java.awt.Font;
import java.awt.event.ActionListener;

import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;

/**
 * @author Matthias
 * @author NielsChristianMouritsen
 */
public class UserMenu extends JPanel{

	private final JLabel lbl_Header;
	private final JButton btn_Back;
	private final JButton btn_DeleteAcc;
	private final JButton btn_CreateAcc;
	private final JButton btn_ViewAccounts;
	private final JLabel logo_ATM;
	
	/**
	 * Contains the information/blueprint on labels and buttons
	 * Sets the window Dimensions and the layout to null
	 */
	public UserMenu() {
		
		setPreferredSize(new Dimension(600, 480));
		setLayout(null);
		
		lbl_Header = new JLabel("User Menu");
		lbl_Header.setFont(new Font("SansSerif", Font.BOLD, 26));
		lbl_Header.setBounds(216, 37, 133, 34);
		add(lbl_Header);
		
		btn_Back = new JButton("Back");
		btn_Back.setFont(new Font("SansSerif", Font.PLAIN, 16));
		btn_Back.setBounds(95, 320, 130, 50);
		add(btn_Back);
		
		btn_DeleteAcc = new JButton("Delete an Account");
		btn_DeleteAcc.setFont(new Font("SansSerif", Font.PLAIN, 16));
		btn_DeleteAcc.setBounds(329, 171, 165, 50);
		add(btn_DeleteAcc);
		
		btn_CreateAcc = new JButton("Create an Account");
		btn_CreateAcc.setFont(new Font("SansSerif", Font.PLAIN, 16));
		btn_CreateAcc.setBounds(329, 110, 165, 50);
		add(btn_CreateAcc);
		
		btn_ViewAccounts = new JButton("View all Accounts");
		btn_ViewAccounts.setFont(new Font("SansSerif", Font.PLAIN, 16));
		btn_ViewAccounts.setBounds(329, 232, 165, 50);
		add(btn_ViewAccounts);
		
		logo_ATM = new JLabel("");
		logo_ATM.setIcon(new ImageIcon(UserMenu.class.getResource("/pic/LOGO Mini.png")));
		logo_ATM.setBounds(15, 15, 50, 50);
		add(logo_ATM);
	}
	
	/**
	 * @return back button
	 */
	public JButton getBtnBack(){
		return btn_Back;
	}
	
	/**
	 * @return delete account button
	 */
	public JButton getBtnDelete(){
		return btn_DeleteAcc;
	}
	
	/**
	 * @return view account button
	 */
	public JButton getBtnView(){
		return btn_ViewAccounts;
	}
	
	/**
	 * @return create account button
	 */
	public JButton getBtnCreate(){
		return btn_CreateAcc;
	}
	
	/** Adds action listeners, in order to define an action 
	 * when a component is called
	 * @param e
	 */
	public void addActionListener(final ActionListener e){
		btn_Back.addActionListener(e);
		btn_DeleteAcc.addActionListener(e);
		btn_CreateAcc.addActionListener(e);
		btn_ViewAccounts.addActionListener(e);
	}

} // end this class